<div class="refentry" lang="en" xml:lang="en"><a id="glBlendFuncSeparate"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glBlendFuncSeparate — specify pixel arithmetic for RGB and alpha components separately</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">glBlendFuncSeparate</b>(</code></td><td>GLenum  </td><td><var class="pdparam">srcRGB</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">dstRGB</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">srcAlpha</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">dstAlpha</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>srcRGB</code></em></span></dt><dd><p>
                    Specifies how the red, green, and blue blending factors are computed.
                    The following symbolic constants are accepted:
                    <code class="constant">GL_ZERO</code>,
                    <code class="constant">GL_ONE</code>,
                    <code class="constant">GL_SRC_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_SRC_COLOR</code>,
                    <code class="constant">GL_DST_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_DST_COLOR</code>,
                    <code class="constant">GL_SRC_ALPHA</code>,
                    <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>,
                    <code class="constant">GL_DST_ALPHA</code>,
                    <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>,
                    <code class="constant">GL_CONSTANT_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_CONSTANT_COLOR</code>,
                    <code class="constant">GL_CONSTANT_ALPHA</code>,
                    <code class="constant">GL_ONE_MINUS_CONSTANT_ALPHA</code>, and
                    <code class="constant">GL_SRC_ALPHA_SATURATE</code>.
                    The initial value is <code class="constant">GL_ONE</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>dstRGB</code></em></span></dt><dd><p>
                    Specifies how the red, green, and blue destination blending factors are
                    computed. The following symbolic constants are accepted:
                    <code class="constant">GL_ZERO</code>,
                    <code class="constant">GL_ONE</code>,
                    <code class="constant">GL_SRC_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_SRC_COLOR</code>,
                    <code class="constant">GL_DST_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_DST_COLOR</code>,
                    <code class="constant">GL_SRC_ALPHA</code>,
                    <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>,
                    <code class="constant">GL_DST_ALPHA</code>,
                    <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>.
                    <code class="constant">GL_CONSTANT_COLOR</code>,
                    <code class="constant">GL_ONE_MINUS_CONSTANT_COLOR</code>,
                    <code class="constant">GL_CONSTANT_ALPHA</code>, and
                    <code class="constant">GL_ONE_MINUS_CONSTANT_ALPHA</code>.
                    The initial value is <code class="constant">GL_ZERO</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>srcAlpha</code></em></span></dt><dd><p>
                    Specified how the alpha source blending factor is computed.  The same
                    symbolic constants are accepted as for <em class="parameter"><code>srcRGB</code></em>.
                    The initial value is <code class="constant">GL_ONE</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>dstAlpha</code></em></span></dt><dd><p>
                    Specified how the alpha destination blending factor is computed.  The same
                    symbolic constants are accepted as for <em class="parameter"><code>dstRGB</code></em>.
                    The initial value is <code class="constant">GL_ZERO</code>.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            In RGBA mode, pixels can be drawn using a function that blends
            the incoming (source) RGBA values with the RGBA values
            that are already in the frame buffer (the destination values).
            Blending is initially disabled.
            Use <a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_BLEND</code>
            to enable and disable blending.
        </p><p>
            <code class="function">glBlendFuncSeparate</code> defines the operation of blending when it is enabled.
            <em class="parameter"><code>srcRGB</code></em> specifies which method is used to scale the
            source RGB-color components.
            <em class="parameter"><code>dstRGB</code></em> specifies which method is used to scale the
            destination RGB-color components.
            Likewise, <em class="parameter"><code>srcAlpha</code></em> specifies which method is used to scale the source alpha
            color component, and <em class="parameter"><code>dstAlpha</code></em> specifies which method is used to scale the
            destination alpha component.
            The possible methods are described in the following table.
            Each method defines four scale factors,
            one each for red, green, blue, and alpha.
        </p><p>
            In the table and in subsequent equations, source and destination
            color components are referred to as
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">R</mi>
                    <mi mathvariant="italic">s</mi>
                    </msub>
                    <msub><mi mathvariant="italic">G</mi>
                    <mi mathvariant="italic">s</mi>
                    </msub>
                    <msub><mi mathvariant="italic">B</mi>
                    <mi mathvariant="italic">s</mi>
                    </msub>
                    <msub><mi mathvariant="italic">A</mi>
                    <mi mathvariant="italic">s</mi>
                    </msub>
                </mfenced>
            </math>
            and
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">R</mi>
                    <mi mathvariant="italic">d</mi>
                    </msub>
                    <msub><mi mathvariant="italic">G</mi>
                    <mi mathvariant="italic">d</mi>
                    </msub>
                    <msub><mi mathvariant="italic">B</mi>
                    <mi mathvariant="italic">d</mi>
                    </msub>
                    <msub><mi mathvariant="italic">A</mi>
                    <mi mathvariant="italic">d</mi>
                    </msub>
                </mfenced>
            </math>.
            The color specified by <a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a> is referred to as
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">R</mi>
                    <mi mathvariant="italic">c</mi>
                    </msub>
                    <msub><mi mathvariant="italic">G</mi>
                    <mi mathvariant="italic">c</mi>
                    </msub>
                    <msub><mi mathvariant="italic">B</mi>
                    <mi mathvariant="italic">c</mi>
                    </msub>
                    <msub><mi mathvariant="italic">A</mi>
                    <mi mathvariant="italic">c</mi>
                    </msub>
                </mfenced>
            </math>.
            They are understood to have integer values between 0 and
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">k</mi>
                    <mi mathvariant="italic">R</mi>
                    </msub>
                    <msub><mi mathvariant="italic">k</mi>
                    <mi mathvariant="italic">G</mi>
                    </msub>
                    <msub><mi mathvariant="italic">k</mi>
                    <mi mathvariant="italic">B</mi>
                    </msub>
                    <msub><mi mathvariant="italic">k</mi>
                    <mi mathvariant="italic">A</mi>
                    </msub>
                </mfenced>
            </math>,
            where
        </p><p>
            </p><p>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">k</mi>
                        <mi mathvariant="italic">c</mi>
                        </msub>
                        <mo>=</mo>
                        <mrow>
                            <msup><mn>2</mn>
                            <mfenced open="" close="">
                                <msub><mi mathvariant="italic">m</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                            </mfenced>
                            </msup>
                            <mo>-</mo>
                            <mn>1</mn>
                        </mrow>
                    </mrow>
                </math>
            </p><p>
        </p><p>
            and
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">m</mi>
                    <mi mathvariant="italic">R</mi>
                    </msub>
                    <msub><mi mathvariant="italic">m</mi>
                    <mi mathvariant="italic">G</mi>
                    </msub>
                    <msub><mi mathvariant="italic">m</mi>
                    <mi mathvariant="italic">B</mi>
                    </msub>
                    <msub><mi mathvariant="italic">m</mi>
                    <mi mathvariant="italic">A</mi>
                    </msub>
                </mfenced>
            </math>
            is the number of red,
            green,
            blue,
            and alpha bitplanes.
        </p><p>
            Source and destination scale factors are referred to as
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">s</mi>
                    <mi mathvariant="italic">R</mi>
                    </msub>
                    <msub><mi mathvariant="italic">s</mi>
                    <mi mathvariant="italic">G</mi>
                    </msub>
                    <msub><mi mathvariant="italic">s</mi>
                    <mi mathvariant="italic">B</mi>
                    </msub>
                    <msub><mi mathvariant="italic">s</mi>
                    <mi mathvariant="italic">A</mi>
                    </msub>
                </mfenced>
            </math>
            and
            <math overflow="scroll">

                <mfenced open="(" close=")">
                    <msub><mi mathvariant="italic">d</mi>
                    <mi mathvariant="italic">R</mi>
                    </msub>
                    <msub><mi mathvariant="italic">d</mi>
                    <mi mathvariant="italic">G</mi>
                    </msub>
                    <msub><mi mathvariant="italic">d</mi>
                    <mi mathvariant="italic">B</mi>
                    </msub>
                    <msub><mi mathvariant="italic">d</mi>
                    <mi mathvariant="italic">A</mi>
                    </msub>
                </mfenced>
            </math>.
            All scale factors have range
            <math overflow="scroll">

                <mfenced open="[" close="]">
                    <mn>0</mn>
                    <mn>1</mn>
                </mfenced>
            </math>.
        </p><p>
        </p><div class="informaltable"><table><colgroup><col /><col /><col /></colgroup><thead><tr><th><span class="bold"><strong>
                        Parameter
                        </strong></span></th><th><span class="bold"><strong>
                        RGB Factor
                        </strong></span></th><th><span class="bold"><strong>
                        Alpha Factor
                        </strong></span></th></tr></thead><tbody><tr><td>
                        <code class="constant">GL_ZERO</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mn>0</mn>
                                <mn>0</mn>
                                <mn>0</mn>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mn>0</mn>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mn>1</mn>
                                <mn>1</mn>
                                <mn>1</mn>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mn>1</mn>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_SRC_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mfrac>
                                    <msub><mi mathvariant="italic">R</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">R</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">G</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">G</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">B</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">B</mi>
                                    </msub>
                                </mfrac>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mfrac>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">s</mi>
                                </msub>
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">A</mi>
                                </msub>
                            </mfrac>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_SRC_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <mfrac>
                                        <msub><mi mathvariant="italic">R</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">R</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">G</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">G</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">B</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">B</mi>
                                        </msub>
                                    </mfrac>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_DST_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mfrac>
                                    <msub><mi mathvariant="italic">R</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">R</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">G</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">G</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">B</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">B</mi>
                                    </msub>
                                </mfrac>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mfrac>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">d</mi>
                                </msub>
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">A</mi>
                                </msub>
                            </mfrac>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_DST_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <mfrac>
                                        <msub><mi mathvariant="italic">R</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">R</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">G</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">G</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">B</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">B</mi>
                                        </msub>
                                    </mfrac>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_SRC_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mfrac>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">s</mi>
                                </msub>
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">A</mi>
                                </msub>
                            </mfrac>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">s</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_DST_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mfrac>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">d</mi>
                                </msub>
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">A</mi>
                                </msub>
                            </mfrac>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                    <mfrac>
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                        <msub><mi mathvariant="italic">k</mi>
                                        <mi mathvariant="italic">A</mi>
                                        </msub>
                                    </mfrac>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <mfrac>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">k</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mfrac>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_CONSTANT_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">R</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                                <msub><mi mathvariant="italic">G</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                                <msub><mi mathvariant="italic">B</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <msub><mi mathvariant="italic">A</mi>
                            <mi mathvariant="italic">c</mi>
                            </msub>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_CONSTANT_COLOR</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <msub><mi mathvariant="italic">R</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">G</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">B</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_CONSTANT_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <msub><mi mathvariant="italic">A</mi>
                            <mi mathvariant="italic">c</mi>
                            </msub>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_ONE_MINUS_CONSTANT_ALPHA</code>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mfenced open="(" close=")">
                                    <mn>1</mn>
                                    <mn>1</mn>
                                    <mn>1</mn>
                                </mfenced>
                                <mo>-</mo>
                                <mfenced open="(" close=")">
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">c</mi>
                                    </msub>
                                </mfenced>
                            </mrow>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mrow>
                                <mn>1</mn>
                                <mo>-</mo>
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">c</mi>
                                </msub>
                            </mrow>
                        </math>
                        </td></tr><tr><td>
                        <code class="constant">GL_SRC_ALPHA_SATURATE</code>
                        </td><td>
                        <math overflow="scroll">

                            <mfenced open="(" close=")">
                                <mi mathvariant="italic">i</mi>
                                <mi mathvariant="italic">i</mi>
                                <mi mathvariant="italic">i</mi>
                            </mfenced>
                        </math>
                        </td><td>
                        <math overflow="scroll">

                            <mn>1</mn>
                        </math>
                        </td></tr></tbody></table></div><p>
            In the table,
        </p><p>
            </p><p>
                <math overflow="scroll">

                    <mrow>
                        <mi mathvariant="italic">i</mi>
                        <mo>=</mo>
                        <mrow>
                            <mi mathvariant="italic">min</mi>
                            <mo>⁡</mo>
                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">A</mi>
                                <mi mathvariant="italic">s</mi>
                                </msub>
                                <mrow>
                                    <mn>1</mn>
                                    <mo>-</mo>
                                    <mfenced open="" close="">
                                        <msub><mi mathvariant="italic">A</mi>
                                        <mi mathvariant="italic">d</mi>
                                        </msub>
                                    </mfenced>
                                </mrow>
                            </mfenced>
                        </mrow>
                    </mrow>
                </math>
            </p><p>
        </p><p>
            To determine the blended RGBA values of a pixel when drawing in RGBA mode,
            the system uses the following equations:
        </p><p>
            </p><p>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">R</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <mrow>
                            <mi mathvariant="italic">min</mi>
                            <mo>⁡</mo>
                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">R</mi>
                                </msub>
                                <mrow>
                                    <msub><mi mathvariant="italic">R</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">s</mi>
                                    <mi mathvariant="italic">R</mi>
                                    </msub>
                                    <mo>+</mo>
                                    <msub><mi mathvariant="italic">R</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">d</mi>
                                    <mi mathvariant="italic">R</mi>
                                    </msub>
                                </mrow>
                            </mfenced>
                        </mrow>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">G</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <mrow>
                            <mi mathvariant="italic">min</mi>
                            <mo>⁡</mo>
                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">G</mi>
                                </msub>
                                <mrow>
                                    <msub><mi mathvariant="italic">G</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">s</mi>
                                    <mi mathvariant="italic">G</mi>
                                    </msub>
                                    <mo>+</mo>
                                    <msub><mi mathvariant="italic">G</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">d</mi>
                                    <mi mathvariant="italic">G</mi>
                                    </msub>
                                </mrow>
                            </mfenced>
                        </mrow>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">B</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <mrow>
                            <mi mathvariant="italic">min</mi>
                            <mo>⁡</mo>
                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">B</mi>
                                </msub>
                                <mrow>
                                    <msub><mi mathvariant="italic">B</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">s</mi>
                                    <mi mathvariant="italic">B</mi>
                                    </msub>
                                    <mo>+</mo>
                                    <msub><mi mathvariant="italic">B</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">d</mi>
                                    <mi mathvariant="italic">B</mi>
                                    </msub>
                                </mrow>
                            </mfenced>
                        </mrow>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">A</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <mrow>
                            <mi mathvariant="italic">min</mi>
                            <mo>⁡</mo>
                            <mfenced open="(" close=")">
                                <msub><mi mathvariant="italic">k</mi>
                                <mi mathvariant="italic">A</mi>
                                </msub>
                                <mrow>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">s</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">s</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                    <mo>+</mo>
                                    <msub><mi mathvariant="italic">A</mi>
                                    <mi mathvariant="italic">d</mi>
                                    </msub>
                                    <mo>⁢</mo>
                                    <msub><mi mathvariant="italic">d</mi>
                                    <mi mathvariant="italic">A</mi>
                                    </msub>
                                </mrow>
                            </mfenced>
                        </mrow>
                    </mrow>
                </math>
            </p><p>
        </p><p>
            Despite the apparent precision of the above equations, blending arithmetic
            is not exactly specified, because blending operates with imprecise integer
            color values.  However, a blend factor that should be equal to 1 is
            guaranteed not to modify its multiplicand, and a blend factor equal to 0
            reduces its multiplicand to 0.  For example, when <em class="parameter"><code>srcRGB</code></em> is
            <code class="constant">GL_SRC_ALPHA</code>, <em class="parameter"><code>dstRGB</code></em> is <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>, and
            <math overflow="scroll">

                <msub><mi mathvariant="italic">A</mi>
                <mi mathvariant="italic">s</mi>
                </msub>
            </math>
            is
            equal to
            <math overflow="scroll">

                <msub><mi mathvariant="italic">k</mi>
                <mi mathvariant="italic">A</mi>
                </msub>
            </math>,
            the equations reduce to simple replacement:
        </p><p>
            </p><p>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">R</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <msub><mi mathvariant="italic">R</mi>
                        <mi mathvariant="italic">s</mi>
                        </msub>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">G</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <msub><mi mathvariant="italic">G</mi>
                        <mi mathvariant="italic">s</mi>
                        </msub>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">B</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <msub><mi mathvariant="italic">B</mi>
                        <mi mathvariant="italic">s</mi>
                        </msub>
                    </mrow>
                </math>
                <math overflow="scroll">

                    <mrow>
                        <msub><mi mathvariant="italic">A</mi>
                        <mi mathvariant="italic">d</mi>
                        </msub>
                        <mo>=</mo>
                        <msub><mi mathvariant="italic">A</mi>
                        <mi mathvariant="italic">s</mi>
                        </msub>
                    </mrow>
                </math>
            </p><p>
        </p><p>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glBlendFuncSeparate</code> is available only if the GL version is 1.4 or greater.
        </p><p>
            Incoming (source) alpha is correctly thought of as a material opacity,
            ranging from 1.0
            (<math overflow="scroll">

                <msub><mi mathvariant="italic">K</mi>
                <mi mathvariant="italic">A</mi>
                </msub>
            </math>),
            representing complete opacity,
            to 0.0 (0), representing complete
            transparency.
        </p><p>
            When more than one color buffer is enabled for drawing,
            the GL performs blending separately for each enabled buffer,
            using the contents of that buffer for destination color.
            (See <a class="citerefentry" href="glDrawBuffer"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>.)
        </p><p>
            Blending affects only RGBA rendering.
            It is ignored by color index renderers.
        </p><p>
            <code class="constant">GL_CONSTANT_COLOR</code>, <code class="constant">GL_ONE_MINUS_CONSTANT_COLOR</code>,
            <code class="constant">GL_CONSTANT_ALPHA</code>, <code class="constant">GL_ONE_MINUS_CONSTANT_ALPHA</code> are available only
            if the GL version is 1.4 or greater or if the <code class="code">ARB_imaging</code> is
            supported by your implementation.
        </p><p>
            <code class="constant">GL_SRC_COLOR</code> and <code class="constant">GL_ONE_MINUS_SRC_COLOR</code> are valid only for
            <em class="parameter"><code>srcRGB</code></em> if the GL version is 1.4 or greater.
        </p><p>
            <code class="constant">GL_DST_COLOR</code> and <code class="constant">GL_ONE_MINUS_DST_COLOR</code> are valid only for
            <em class="parameter"><code>dstRGB</code></em> if the GL version is 1.4 or greater.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if either <em class="parameter"><code>srcRGB</code></em> or <em class="parameter"><code>dstRGB</code></em> is not an
            accepted value.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glBlendFuncSeparate</code>
            is executed between the execution of <a class="citerefentry" href="glBegin"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <a class="citerefentry" href="glEnd"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_BLEND_SRC_RGB</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_BLEND_SRC_ALPHA</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_BLEND_DST_RGB</code>
        </p><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_BLEND_DST_ALPHA</code>
        </p><p>
            <a class="citerefentry" href="glIsEnabled"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_BLEND</code>
        </p><p>
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glAlphaFunc"><span class="citerefentry"><span class="refentrytitle">glAlphaFunc</span></span></a>,
            <a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a>,
            <a class="citerefentry" href="glBlendFunc"><span class="citerefentry"><span class="refentrytitle">glBlendFunc</span></span></a>,
            <a class="citerefentry" href="glBlendEquation"><span class="citerefentry"><span class="refentrytitle">glBlendEquation</span></span></a>,
            <a class="citerefentry" href="glClear"><span class="citerefentry"><span class="refentrytitle">glClear</span></span></a>,
            <a class="citerefentry" href="glDrawBuffer"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>,
            <a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
            <a class="citerefentry" href="glLogicOp"><span class="citerefentry"><span class="refentrytitle">glLogicOp</span></span></a>,
            <a class="citerefentry" href="glStencilFunc"><span class="citerefentry"><span class="refentrytitle">glStencilFunc</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/" target="_top">https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
